package com.tjetc._6big;

import java.math.BigDecimal;
import java.math.RoundingMode;

public class _2BigDecimal {
    public static void main(String[] args) {
        /*
            BigDecimal: 在类中跟💰相关的 全部用这个
         */

        BigDecimal num1 = new BigDecimal("10.111");
        BigDecimal num2 = new BigDecimal("10.11163284623");

        double num3 = 10.111;
        double num4 = 10.111;
        System.out.println("num3 * num4 = " + num3 * num4);

        System.out.println("num1.add(num2) = " + num1.add(num2));
        System.out.println("num1.subtract(num2) = " + num1.subtract(num2));
        System.out.println("num1.multiply(num2) = " + num1.multiply(num2));
        System.out.println("num1.divide(num2) = " + num1.divide(num2, RoundingMode.UP));
    }
}
